package com.icss.daos;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.icss.beans.OverTimeVO;



public class OverTimeDao {

	
	public void insertOvertime(String sql){
		Dao dao=new Dao();
		boolean flag=dao.execute(sql);
		if(flag==true){
			System.out.println("加班记录成功");
		}else{System.out.println("加班操作失败");}
				
	}
		
	public List<OverTimeVO> selectOvertime(String sql){
		Dao dao=new Dao();
		List<OverTimeVO> list=new ArrayList();
		ResultSet rs= dao.query(sql);
		try {
			while(rs.next()){
				OverTimeVO vo=new OverTimeVO();
				vo.setPersonName(rs.getString("personName"));
				vo.setOvertimeContent(rs.getString("overtimeContent"));
				vo.setBeginTime(rs.getDate("beginTime"));
				vo.setEndTime(rs.getDate("endTime"));
				vo.setShenpiPerson(rs.getString("shenpiPerson"));
				list.add(vo);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
	} 	
		


	
}
